﻿using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Data;

namespace ChoJu.Single.Converters.Rating
{
    public class ResultColorConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            var msg = value?.ToString();
            if(msg?.Contains("青") == true)
                return System.Windows.Media.Brushes.Green;
            else if(msg?.Contains("杂") == true)
                return System.Windows.Media.Brushes.Red;

            return System.Windows.Media.Brushes.Orange;
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }
}
